1. Field of the Invention
The present invention relates to an image processing apparatus, an image direction determining method, and a computer program product.
2. Description of the Related Art
In a technology that has been generally known for determining the direction of an image, a character is extracted from the image, and its feature amount is then extracted. Then, a degree of similarity between the character and each of characters in four directions in a dictionary is found. Then, a direction with the highest degree of similarity is determined as the direction of the image. In such a technology, the degrees of similarity of the character for determining the direction in all of the four directions are added together to determine the direction. Therefore, for example, as in the case of “6” and “9”, when the character has a high degree of similarity to a character in an opposite direction, the direction of the document image may be erroneously determined because the degrees of similarity are accumulated together.
To solve such a problem, Japanese Patent Application Laid-Open No. 2000-113103 discloses a technology in which a text area is extracted from image data, and character recognition is performed in four directions for each character. Then, a degree of similarity in character recognition is obtained in each direction, only degrees of similarity exceeding a predefined threshold are added up, and a direction with the highest degree of similarity is determined as the direction of an image.
However, if the conventional technology is used to perform character recognition on extracted characters in four directions, a high load is imposed on a central processing unit (CPU). For this reason, in an imaging device, such as a scanner, copier, or digital camera, installed with only a CPU with low specifications compared with a personal computer (PC), when an Optical Character Recognition (OCR) process is performed, the processing speed is impractically low.
To increase the processing speed, a technology has been proposed in which, based on layout information of text lines in image data, the direction of an image is determined. In the conventional technology, when four directions, i.e., up, down, right, and left, are determined, whether the direction of the image is a vertical direction or a horizontal direction can be correctly determined. However, a determination as to whether the direction of the image determined as a vertical direction is an up direction or a down direction or a determination as to whether the direction of the image determined as a horizontal direction is a right direction or a left direction may be erroneously made because a difference in layout information is small.